package com.eastfair.home.service.impl;

import com.eastfair.core.base.R;
import com.eastfair.core.exception.BizException;
import com.eastfair.home.service.HomeReportVenueSpaceAuditService;
import com.eastfair.venuebooking.api.ReportVenueSpaceAuditFeign;
import com.eastfair.venueservice.dto.ReportVenueSpaceAuditDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 一键报馆审核服务.
 *
 * @author dqq
 * @date 2022 /9/13
 */
@Service
@Slf4j
public class HomeReportVenueSpaceAuditServiceImpl implements HomeReportVenueSpaceAuditService {

    @Resource
    private ReportVenueSpaceAuditFeign reportVenueSpaceAuditFeign;

    @Override
    public boolean submit(ReportVenueSpaceAuditDTO reportVenueSpaceAuditDTO) {
        R<Boolean> result = reportVenueSpaceAuditFeign.submit(reportVenueSpaceAuditDTO);
        if (!result.getIsSuccess()) {
            throw BizException.wrap(result.getCode(), result.getMsg());
        }
        return result.getData();
    }
}